<ul class="posts">
	{% for post in posts %}
	<li class="post">
		<div class="post-thumbnail">
			<a href="{{ url_for('.user', username=post.author.username) }}">
				<img class="img-rounded profile-thumbnail" src="../static/{{ range(1,8)|random }}.jpg">
			</a>
		</div>
		<div class="post-content">
			<div class="post-date">{{ moment(post.timestamp).fromNow() }}</div>
			<div class="post-author">
				<a href="{{ url_for('.user', username=post.author.username) }}">{{ post.author.name }}
				</a>
			</div>
			<div class="post-body">
				{% if post.body_html %}
					{{ post.body_html | safe }}
				{% else %}
					{{ post.body }}
				{% endif %}
			</div>
			<div class="post-footer">
				<a href="{{ url_for('.post', id=post.id) }}">
					<span class="label label-default">>>></span>
				</a>
				{% if current_user == post.author %}
					<a href="{{ url_for('.edit', id=post.id) }}">
					<span class="label label-primary">编辑</span>
					</a>
				{% elif current_user.is_administrator() %}
					<a href="{{ url_for('.edit', id=post.id) }}">
					<span class="label label-danger">编辑 [Admin]</span>
					</a>
				{% endif %}
				<a href="{{ url_for('.post', id=post.id) }}#comments">
					<span class="label label-primary">
						{{ post.comments.count() }} 条评论
					</span>
				</a>
			</div>
		</div>
	</li>
	{% endfor %}
</ul>